package com.xydtech.ecard.ftp.service.impl;

import com.xydtech.ecard.ftp.domain.FtpDepositLoanRateConfig;
import com.xydtech.ecard.ftp.mapper.FtpDepositLoanRateConfigMapper;
import com.xydtech.ecard.ftp.service.IFtpDepositLoanRateConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: liliya
 * @Description: FTP存贷款收益率曲线ftp_deposit_loan_rate_config
 * @Date: Created in 2023/8/16 16:32
 * @Modified:
 */
@Service
public class FtpDepositLoanRateConfigServiceImpl implements IFtpDepositLoanRateConfigService {

    @Autowired
    private FtpDepositLoanRateConfigMapper ftpDepositLoanRateConfigMapper;

    /**
     * 查询全表基础数据
     * @return
     */
    @Override
    public List<FtpDepositLoanRateConfig> selectBaseList(FtpDepositLoanRateConfig config){
        return ftpDepositLoanRateConfigMapper.selectBaseList();
    }

    /**
     * 通过期限匹配法:定价期限(天数下限,闭区间)查对应区间
     * @param pricingPeriod
     * @return
     */
    @Override
    public FtpDepositLoanRateConfig selectBaseListByDayOfUnderClosed(Integer pricingPeriod, Integer configType) {
        return ftpDepositLoanRateConfigMapper.selectBaseListByDayOfUnderClosed(pricingPeriod,configType);
    }


    /**
     * 通过期限匹配法:定价期限(天数上限,闭区间)和config_key查对应区间
     * @param pricingPeriod
     * @param configKey
     * @return
     */
    @Override
    public FtpDepositLoanRateConfig selectBaseListByDayOfUpperClosed(Integer pricingPeriod, String configKey, Integer configType){
        return ftpDepositLoanRateConfigMapper.selectBaseListByDayOfUpperClosed(pricingPeriod, configKey,configType);
    }

    /**
     * 通过期限匹配法:天数下限查对应区间
     * @param configUnderDay
     * @return
     */
    @Override
    public FtpDepositLoanRateConfig selectBaseListByConfigUnderDay(Integer configUnderDay, Integer configType) {
        return ftpDepositLoanRateConfigMapper.selectBaseListByConfigUnderDay(configUnderDay,configType);
    }

    /**
     * 通过期限匹配法:期限标识,N天/周W/月M/Y年查对应区间
     * @param configKey
     * @return
     */
    @Override
    public FtpDepositLoanRateConfig selectBaseListByConfigKey(String configKey, Integer configType) {
        return ftpDepositLoanRateConfigMapper.selectBaseListByConfigKey(configKey,configType);
    }

    /**
     * 查询
     */
    @Override
    public FtpDepositLoanRateConfig selectBaseById(Integer id) {
        return ftpDepositLoanRateConfigMapper.selectBaseById(id);
    }

    /**
     * 新增
     */
    @Override
    public int insertBase(FtpDepositLoanRateConfig config) {
        return ftpDepositLoanRateConfigMapper.insertBase(config);
    }

    /**
     * 修改
     */
    @Override
    public int updateBase(FtpDepositLoanRateConfig config) {
        return ftpDepositLoanRateConfigMapper.updateBase(config);
    }

    /**
     * 删除
     */
    @Override
    public int deleteBaseById(Long configId) {
        return ftpDepositLoanRateConfigMapper.deleteBaseById(configId);
    }

    /**
     * 批量删除
     */
    @Override
    public int deleteBaseByIds(Long[] configIds) {
        return ftpDepositLoanRateConfigMapper.deleteBaseByIds(configIds);
    }


}
